Add new "target module replace" command #148735
Draft
+267
−33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
For dump debugging (both minidump and coredump), the dump most likely only contains the process memory without real modules so placeholder object files are created for the modules.
LLDB lacks a feature to hydrate/upgrade these dummy modules into real modules. This diff bridges the gap with a new
target module replace
command.The new command would replace the place holder object file in target module with input new/real object file and refresh the symbol table/stack. The target module is located with file name matching, users can also specify the target module via "-s" option if the module names differ.
Another change is placeholder modules will have
(*)
added at the end as hint.The workflow would be:
image list
to see place holder modulestarget module replace <downloaded_fbpkg_module>
Test Plan:
A new unit test is added.
c4crasher end-to-end debugging is tested.
c4crasher testing workflow is documented here: https://www.internalfb.com/intern/wiki/Coredumper/Developer_Guide/Development_Process/
Reviewers: wanyi, #lldb_team
Reviewed By: wanyi
Subscribers: gclayton, #lldb_team
Differential Revision: https://phabricator.intern.facebook.com/D43756670